<?php
if (!empty($customedateSessionForbatch)) {
    $customeDaysSession = $customedateSessionForbatch;
    $scheduletype = 'Date';
} else {
    $customeDaysSession = $customeDaysSessionForbatch;
    $scheduletype = 'Day';
}
?>
<h4><?php echo 'Batch ' . $scheduletype . '  Sessions(' . count($customeDaysSession) . ')'; ?></h4>
<table class="batch-detail">
    <tr>
        <th><?php echo $scheduletype ?></th>
        <th>Start Time</th>
        <th>End  Time</th>
        <th>Flexible</th>
    </tr>
    <?php foreach ($customeDaysSession as $customeDayValue) { ?>
        <tr>
            <td><?php echo ($scheduletype == 'Day') ? Courses::getSchedulename($customeDayValue['schedule_id']) : $customeDayValue['date']; ?></td>
            <td><?php echo $customeDayValue['time_from']; ?></td>
            <td><?php echo $customeDayValue['time_to']; ?></td>
            <td><?php echo ($customeDayValue['is_flexible'] == '') ? 'No' : 'Yes'; ?></td>
        </tr>
    <?php }
    ?>
</table>